import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 * 
 */

/**
 * @author DAM_S
 *
 */
public class GestionTareaBD implements GestionTareas {
	 try {
		  Class.forName("com.mysql.jdbc.Driver");
		  Connection conn =
		  DriverManager.getConnection("jdbc:mysql://localhost/tareas","root","");
		  Statement stat = conn.createStatement();
		  ResultSet resultset = stat.executeQuery("select * from tarea;");
		  
		    while (resultset.next()) {
		      System.out.println("id = " + resultset.getString("id"));
		      System.out.println("name = " + resultset.getString("name"));
		    }
	 }catch(Exception e){
		   System.err.println("Apurtu du!!!"+ e.getMessage());
	 }
		    
	/* (non-Javadoc)
	 * @see GestionTareas#introducirTarea(java.lang.String)
	 */
	@Override
	public int introducirTarea(String tarea) {
		// TODO Auto-generated method stub
		return 0;
	}

	/* (non-Javadoc)
	 * @see GestionTareas#eliminarTarea(int)
	 */
	@Override
	public void eliminarTarea(int id) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see GestionTareas#modificarTarea(Tarea)
	 */
	@Override
	public void modificarTarea(Tarea tarea) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see GestionTareas#buscarTarea(int)
	 */
	@Override
	public Tarea buscarTarea(int id) {
		// TODO Auto-generated method stub
		return null;
	}

}
